<!DOCTYPE html>
<html lang="ch" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>activity</title>
    <style>
        h3 {
            font-size:36px;
        }
        p {
            font-size: 24px;
        }
        body {
            padding:10px;
            background-color: white;
            font-size:24px;
        }
        .container {
            width:80%;
            /*background-color: lightgrey;*/
            margin: 0 auto;
            padding:20px;
        }
        table {
            border: 1px solid black;
            /*border-collapse: collapse;*/
        }
        th, td {
            border: 1px solid black;
            padding: 5px;
        }
    </style>
</head>
<body>
<div class="container">
            <h4>表格数据</h4>

    <a th:href="@{/th/add-activity}">添加活动</a>
    <table>
                <tr>
                    <th>NO.</th>
                    <th>name</th>
                    <th>title</th>
                    <th>description</th>
                    <th>startTime</th>
                    <th>operations</th>
                </tr>
                <!-- act, state -->
                <tr th:each ="act, state: ${activities}">
                    <td th:text="${state.index + 1}">1</td>
                    <td th:text="${act.name}"></td>
                    <td th:text="${act.title}"></td>
                    <td th:text="${act.description}"></td>
                    <td th:text="${#dates.format(act.startTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
                    <td><a th:href="@{/th/delete?name=} + ${act.name}">删除</a></td>
                </tr>
            </table>

</div>
</body>
</html>